package com.beauty.dressing.module.main.holder;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.TextView;

import com.beauty.dressing.R;
import com.beauty.dressing.common.base.BaseRecyclerViewHolder;
import com.beauty.dressing.common.bean.BaseBean;
import com.beauty.dressing.common.bean.LeaseItem;
import com.beauty.dressing.common.bean.SaleItem;
import com.beauty.dressing.common.bean.ShowItem;
import com.beauty.dressing.module.main.activity.VideoPlayActivity;
import com.beauty.dressing.module.market.activity.GoodsDetailActivity;
import com.beauty.dressing.module.market.activity.LeaseDetailActivity;
import com.beauty.dressing.rxandroid.api.ApiManager;
import com.facebook.drawee.view.SimpleDraweeView;
import com.xiaolanba.commonlib.fresco.FrescoUtil;

/**
 * @author xutingz
 * @E-mail xutz@xianlanba.com
 * @date 2018/05/03
 */

public class CourseItemHolder extends BaseRecyclerViewHolder<BaseBean> {

    private SimpleDraweeView mImage;
    private TextView mPlayCount,mPlayType;
    public CourseItemHolder(Context context, LayoutInflater inflater, ViewGroup viewGroup) {
        super(R.layout.course_item_holder, context, inflater, viewGroup);
    }

    @Override
    public void findView() {
        mImage = (SimpleDraweeView) itemView.findViewById(R.id.image);
        mPlayCount = itemView.findViewById(R.id.playcount_txt);
        mPlayType = itemView.findViewById(R.id.type_txt);
    }

    @Override
    public void bindData(BaseBean bean, int position) {
        FrescoUtil.loadImage(mImage,"https://tvax3.sinaimg.cn/crop.10.0.729.729.180/778ef491ly8fend6q4acrj20ku0k93zy.jpg");
        registerItemClick(bean,position);
        mPlayCount.setText("观看数:"+(getAdapterPosition()+1));
    }


    @Override
    public void onItemClick(BaseBean bean, int position) {
        VideoPlayActivity.startActivity(mContext,null);
    }
}
